<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 因为random取随机数是取0-1之间但是包含0不包括1,所以当取0-10的随机数时也不包含10,那就需要将随机数的结果乘以11,这样就可以取到10,取不到11,在进行向下取整,就是0-10的随机数了
    let re = Math.floor(Math.random() * (10 + 1))
    console.log(re)
    let re1 = Math.floor(Math.random() * (5 + 1)) + 5
    console.log(re1)
    let re3 = Math.ceil(Math.random())
    console.log(re3)
    let re4 = Math.random()
    document.write(re4)
  </script>
</body>

</html>